﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HBattle;
using SimpleProtobuf;

public class GameStart : MonoBehaviour
{
    void Start()
    {
        EntityManager.Instance.Start();
        NetworkManager.Instance.Start();

        Command msg = new Command
        {
            Ot = OperateType.Insert,
            Pd = new PlayerData
            {
                Id = 99,
                Name = "hello",
                Level = 999,
            }
        };

        NetworkManager.Instance.SendMessage(1, msg);
    }

    void Update()
    {
        EntityManager.Instance.Update();
        NetworkManager.Instance.Update();
    }

    void OnDestroy()
    {
        EntityManager.Instance.Destroy();
        NetworkManager.Instance.Destroy();
    }
}
